added SSCLI 1.0
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2008 / CSWebBrowserAutomation / HtmlPassword.cs
blob531aebc35917d54cd0680286fb70ec4334562d76
1 /****************************** Module Header ******************************\
2 * Module Name: HtmlPassword.cs
3 * Project: CSWebBrowserAutomation
4 * Copyright (c) Microsoft Corporation.
5 *
6 * This class HtmlPassword represents an HtmlElement with the tag "input" and its
7 * type is "password".
8 *
9 * This source is subject to the Microsoft Public License.
10 * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11 * All other rights reserved.
13 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
14 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16 \***************************************************************************/
18 using System.Windows.Forms;
19 using System.Security.Permissions;
21 namespace CSWebBrowserAutomation
23 public class HtmlPassword : HtmlInputElement
25 public string Value { get; set; }
27 /// <summary>
28 /// This parameterless constructor is used in deserialization.
29 /// </summary>
30 public HtmlPassword() { }
32 /// <summary>
33 /// Initialize an instance of HtmlPassword. This constructor is used by
34 /// HtmlInputElementFactory.
35 /// </summary>
36 [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
37 public HtmlPassword(HtmlElement element)
38 : base(element.Id)
40 Value = element.GetAttribute("value");
43 /// <summary>
44 /// Set the value of the HtmlElement.
45 /// </summary>
46 [PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
47 public override void SetValue(HtmlElement element)
49 element.SetAttribute("value", Value);